package com.sdwz.borrow.client;

import com.sdwz.borrow.entity.BookInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "service-library")
@Repository
public interface LibraryClient {
    @GetMapping("/api/library/book/getLoanableQuantity/{bookId}")
    public Integer getLoanableQuantity(@PathVariable("bookId") String bookId);

    @PostMapping("/api/library/book/changeLoanableQuantity")
    public boolean changeLoanableQuantity(@RequestBody BookInfo bookInfo);

    @GetMapping("/api/library/book/get/{id}")
    public BookInfo getBook(@PathVariable("id") String id);
}
